﻿using CleanArchitecture.Infrastructure.Entities.System.DataDic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CleanArchitecture.Infrastructure.DataMapping.DataDic
{
    /// <summary>
    /// Represents a customer role mapping configuration
    /// </summary>
    public partial class SystemDataDicTreeMap : NowaEntityTypeConfiguration<SystemDataDicTree>
    {
        #region Methods

        /// <summary>
        /// Configures the entity
        /// </summary>
        /// <param name="builder">The builder to be used to configure the entity</param>
        public override void Configure(EntityTypeBuilder<SystemDataDicTree> builder)
        {
            builder.ToTable("sys_datadictree");
            builder.HasKey(dictree => dictree.Id);

            builder.Property(dictree => dictree.DataDicTreeName).HasMaxLength(255).IsRequired();
            builder.Property(dictree => dictree.DisplayName).HasMaxLength(255);
            
            base.Configure(builder);
        }

        #endregion
    }
}
